package com.syty.demo.result;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.NoArgsConstructor;

/**
 * 对异常属性进行封装的异常枚举类
 */
@ApiModel(description = "异常类属性封装")
@NoArgsConstructor
public enum ExceptionResultSet {
    MYTEST_ERROR_CODE(1001,"测试代码"),
    USER_LOGIN_INFO_NULL(1002,"用户信息不能为空！"),
    USER_REGISTER_INFO_NULL(1003,"注册信息不能为空！"),
    USER_REGISTER_NAME_ALREADY_EXIST(1004,"用户名已存在！"),
    USER_REGISTER_EMAIL_FORMAT_ERROR(1005,"邮箱格式错误！"),
    USER_REGISTER_LOGININFO_SAVE_ERROR(1006,"注册登录信息保存失败！"),
    USER_REGISTER_ADD_ERROR(1007,"用户添加失败"),//controller层最后的校验出现错误
    USER_REGISTER_USERINFO_SAVE_ERROR(1008,"保存用户信息失败！"),
    USER_REMAKE_USER_NOTEXIST(1009,"用户不存在！"),
    USER_REMAKE_EMAIL_INCOMPATIBLE(1010,"邮箱不匹配"),
    USER_REMAKE_INFO_NULL(1011,"信息为空"),
    USER_REMAKE_ERROR(1012,"重置失败");



    @ApiModelProperty(value = "错误代码")
    private Integer errorCode;
    @ApiModelProperty(value = "异常信息")
    private String message;

    ExceptionResultSet(Integer errorCode) {
        this.errorCode = errorCode;
    }

    ExceptionResultSet(Integer errorCode, String message) {
        this.errorCode = errorCode;
        this.message = message;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
